import _ from 'lodash';
import {Storage} from '@ionic/storage';
import {BaseRequestOptions, Http} from '@angular/http';
import {MockBackend} from '@angular/http/testing';
import {AuthHttp, AuthConfig} from 'angular2-jwt';
import {ErrorHandler, Injector, ReflectiveInjector} from '@angular/core';

// pdf容器
import {PdfViewerComponent} from 'ng2-pdf-viewer';

window['PDFJS'].disableWorker = true;

// // 修复pdf转canvas模糊的问题
// PdfViewerComponent.prototype['renderPage'] = function (pageNumber) {
// 	var _this = this;
// 	return this._pdf.getPage(pageNumber).then(function (page) {
// 		var viewport = page.getViewport(_this._zoom, _this._rotation);
// 		var container = _this.element.nativeElement.querySelector('div');
// 		var canvas = document.createElement('canvas');
// 		var div = document.createElement('div');
// 		if (!_this._originalSize) {
// 			viewport = page.getViewport(_this.element.nativeElement.offsetWidth / viewport.width, _this._rotation);
// 		}
// 		if (!_this._showAll) {
// 			_this.removeAllChildNodes(container);
// 		}
// 		div.appendChild(canvas);
// 		container.appendChild(div);
// 		canvas.height = viewport.height * 2;
// 		canvas.width = viewport.width * 2;
// 		canvas.style.width = viewport.width + 'px';
// 		canvas.style.height = viewport.height + 'px';
// 		var ctx = canvas.getContext('2d');
// 		ctx.scale(2, 2);
// 		page.render({
// 			canvasContext: ctx,
// 			viewport: viewport
// 		});
// 		if (_this._renderText) {
// 			_this.renderPageOverlay(page, viewport, container);
// 		}
// 	});
// }

// import cordova plugin
import {StatusBar} from '@ionic-native/status-bar';
import {BackgroundMode} from '@ionic-native/background-mode';
import {SMS} from '@ionic-native/sms';
import {Device} from '@ionic-native/device';
import {LocalNotifications} from '@ionic-native/local-notifications';
import {InAppBrowser} from '@ionic-native/in-app-browser';
import {FileOpener} from '@ionic-native/file-opener';
import {File} from '@ionic-native/file';
import {Keyboard} from '@ionic-native/keyboard';
import {CallNumber} from '@ionic-native/call-number';


// ===========================所有公用provider==========================

// 公用组件
import {Config} from '../providers/config';
import {HttpClient} from '../providers/httpClient';
import {Common} from '../providers/common';
import {FlowParmeter} from '../pages/draft/detail/flowParmeter.model';

// token保存机制
export function getAuthHttp(http) {
  let storage = new Storage({
    name: "gfoa"
  });

  return new AuthHttp(new AuthConfig({
    headerPrefix: '',
    noJwtError: true,
    globalHeaders: [{'Accept': 'application/json'}],
    tokenGetter: (() => storage.get('id_token')),
  }), http);
}

class ErrorService {
  constructor(public storage?: Storage) {

  }
}

/**
 * 重写错误处理
 */
class MyErrorHandler implements ErrorHandler {
  handleError(err: any): void {
    let storage = new Storage({
      name: "gfoa"
    });
    storage.get("userInfo").then((userInfo) => {
      storage.get("errorMessage").then((errorMessage) => {
        if (errorMessage) {
          errorMessage.push({
            content: err.name + "----" + err.message,
            url: window.location.href,
            username: userInfo ? userInfo.loginid : ""
          });
        } else {
          errorMessage = [{
            content: err.name + "----" + err.message,
            url: window.location.href,
            username: userInfo ? userInfo.loginid : ""
          }];
        }
        storage.set("errorMessage", errorMessage);
      });
    });
    // console.info(err.name + "----" + err.message);
    // console.log(window.location.href);
    console.info(err);
    alert('系统发生了未知异常,请联系管理员');
  }
}

// 统一导出所有公用provider
let _providers: any = [Config, {
  provide: AuthHttp,
  useFactory: getAuthHttp,
  deps: [Http]
}, HttpClient,
  Common,
  FlowParmeter,
  StatusBar,
  BackgroundMode,
  SMS,
  Device,
  LocalNotifications,
  InAppBrowser,
  FileOpener,
  File,
  Keyboard,
  CallNumber
]

// 加入错误处理
_providers.push({
  "provide": ErrorHandler,
  "useClass": MyErrorHandler
});


// ===========================所有页面模块==========================

import {GfoaApp} from './app.component';

// ArchiveModule
import {ArchivePage} from '../pages/archive/archive.component';

let ArchiveLinkers: any = [{
  component: ArchivePage, name: 'ArchivePage', segment: 'archive'
}];

// AuthorizationModule
import {AuthorizationListPage} from '../pages/authorization/list/list.component'
import {AuthorizationDetailPage} from '../pages/authorization/detail/detail.component'
import {SysDirPage} from '../pages/authorization/detail/sysDir.component'


let AuthorizationLinkers: any = [{
  component: AuthorizationListPage, name: 'AuthorizationListPage', segment: 'authorization/list/:whichPage'
}, {
  component: AuthorizationDetailPage, name: 'AuthorizationDetailPage', segment: 'authorization/detail/:item/:type'
}, {
  component: SysDirPage, name: 'SysDirPage', segment: 'authorization/sysDir/:module'
}];


// ContactModule
import {ContactListPage} from '../pages/contact/list/list.component'
import {ContactChoosePage} from '../pages/contact/choose/choose.component'
import {ContactDetailPage} from '../pages/contact/detail/detail.component'


let ContactLinkers: any = [{
  component: ContactListPage, name: 'ContactListPage', segment: 'contact/list'
}, {
  component: ContactChoosePage, name: 'ContactChoosePage', segment: 'contact/choose'
}, {
  component: ContactDetailPage, name: 'ContactDetailPage', segment: 'contact/detail'
}];


// DemoModule
import {DemoListPage} from '../pages/demo/list/list.component'
import {DemoDetailPage} from '../pages/demo/detail/detail.component'


let DemoLinkers: any = [{
  component: DemoListPage, name: 'DemoListPage', segment: 'demo/list'
}, {
  component: DemoDetailPage, name: 'DemoDetailPage', segment: 'demo/detail'
}];

// DraftModule
import {DraftListPage} from '../pages/draft/list/list.component'
import {DraftDetailPage} from '../pages/draft/detail/detail.component'
import {DraftAddrModal} from '../pages/draft/detail/addr.modal'
import {DraftCompanyCodeModal} from '../pages/draft/detail/companyCode.modal'
import {DraftIndustryInfoModal} from '../pages/draft/detail/industryInfo.modal'

let DraftLinkers: any = [{
  component: DraftListPage, name: 'DraftListPage', segment: 'draft/list'
}, {
  component: DraftDetailPage, name: 'DraftDetailPage', segment: 'draft/detail/:type'
}, {
  component: DraftAddrModal, name: 'DraftAddrModal', segment: 'draft/modal/addr'
}, {
  component: DraftCompanyCodeModal, name: 'DraftCompanyCodeModal', segment: 'draft/modal/companyCode'
}, {
  component: DraftIndustryInfoModal, name: 'DraftIndustryInfoModal', segment: 'draft/modal/industryInfo'
}];


// EmailModule
import {EmailListPage} from '../pages/email/list/list.component'
import {EmailIndexPage} from '../pages/email/index/index.component'
import {EmailDetailPage} from '../pages/email/detail/detail.component'
import {EmailSendPage} from '../pages/email/send/send.component'
import {EmailQueryPage} from '../pages/email/query/query.component'


let EmailLinkers: any = [{
  component: EmailIndexPage, name: 'EmailIndexPage', segment: 'email/index'
}, {
  component: EmailListPage, name: 'EmailListPage', segment: 'email/list/:listType'
}, {
  component: EmailDetailPage, name: 'EmailDetailPage', segment: 'email/detail/:type/:id'
}, {
  component: EmailSendPage, name: 'EmailSendPage', segment: 'email/send'
}, {
  component: EmailQueryPage, name: 'EmailQueryPage', segment: 'email/query'
}];


// FlowModule
import {FlowListPage} from '../pages/flow/list/list.component'
import {FlowQueryPage} from '../pages/flow/query/query.component'
import {FlowTypePage} from '../pages/flow/type/type.component'

let FlowLinkers: any = [{
  component: FlowListPage, name: 'FlowListPage', segment: 'flow/list'
}, {
  component: FlowQueryPage, name: 'FlowQueryPage', segment: 'flow/query'
}, {
  component: FlowTypePage, name: 'FlowTypePage', segment: 'flow/type'
}];

// InfoModule
import {InfoListPage} from '../pages/info/list/list.component'
import {InfoDetailPage} from '../pages/info/detail/detail.component'


let InfoLinkers: any = [{
  component: InfoListPage, name: 'InfoListPage', segment: 'info/list/:type'
}, {
  component: InfoDetailPage, name: 'InfoDetailPage', segment: 'info/detail'
}];


// LockModule
import {LockPage} from '../pages/lock/lock.component'

let LockLinkers: any = [{
  component: LockPage, name: 'LockPage', segment: 'lock'
}];


// LoginModule
import {LoginPage} from '../pages/login/login.component'

let LoginLinkers: any = [{
  component: LoginPage, name: 'LoginPage', segment: 'login'
}];

// TodoModule
import {TodoPage} from '../pages/todo/todo.component'

let TodoLinkers: any = [{
  component: TodoPage, name: 'TodoPage', segment: 'todo'
}];

// MainModule
import {MainPage} from '../pages/main/main.component'

let MainLinkers: any = [{
  component: MainPage, name: 'MainPage', segment: 'main'
}];


// Setting
import {SettingIndexPage} from '../pages/setting/index/index.component'
import {SettingNotePage} from '../pages/setting/note/note.component'
import {SettingFeedbackPage} from '../pages/setting/feedback/feedback.component'
import {SettingSealPage} from '../pages/setting/seal/seal.component'
import {SettingPushPage} from '../pages/setting/push/push.component'


let SettingLinkers: any = [{
  component: SettingIndexPage, name: 'SettingIndexPage', segment: 'setting/index',
}, {
  component: SettingNotePage, name: 'SettingNotePage', segment: 'setting/note'
}, {
  component: SettingFeedbackPage, name: 'SettingFeedbackPage', segment: 'setting/feedback'
}, {
  component: SettingSealPage, name: 'SettingSealPage', segment: 'setting/seal'
}, {
  component: SettingPushPage, name: 'SettingPushPage', segment: 'setting/push'
}];


// TabsModule
import {TabsPage} from '../pages/tabs/tabs.component'

let TabsLinkers: any = [{
  component: TabsPage, name: 'TabsPage', segment: 'tabs'
}];


// TaskModule
import {TaskListPage} from '../pages/task/list/list.component'
import {TaskDetailPage} from '../pages/task/detail/detail.component'
import {EmpPage} from '../pages/task/detail/emp.component'
import {BT0107Page} from '../pages/task/detail/bt0107.component'
import {FlowApprovalPage} from '../pages/task/detail/flowApproval.component'
import {FlowLogPage} from '../pages/task/detail/flowLog.component'
import {CashPlanPage} from '../pages/task/detail/cashPlanDetail.component'
import {ZcmxPage} from '../pages/task/detail/zcmx.component'
import {ZcmxListPage} from '../pages/task/detail/zcmxList.component'
import {TaskInfoListPage} from '../pages/task/detail/infoList.component';
import {FlowPressPage} from "../pages/task/detail/flowPress.component";

let TaskLinkers: any = [{
  component: TaskListPage, name: 'TaskListPage', segment: 'task/list'
}, {
  component: TaskDetailPage, name: 'TaskDetailPage', segment: 'task/detail/:item'
}, {
  component: EmpPage, name: 'EmpPage', segment: 'task/emp/:isSelAddr/:empnames/:empnamesId'
}, {
  component: BT0107Page, name: 'BT0107Page', segment: 'task/emp/:item'
}, {
  component: FlowApprovalPage, name: 'FlowApprovalPage', segment: 'task/approval/:item'
}, {
  component: FlowLogPage, name: 'FlowLogPage', segment: 'task/log/:item'
}, {
  component: CashPlanPage, name: 'CashPlanPage', segment: 'task/cashPlan/:bid'
}, {
  component: ZcmxPage, name: 'ZcmxPage', segment: 'task/zcmx/:bosid'
}, {
  component: ZcmxListPage, name: 'ZcmxListPage', segment: 'task/zcmxList/:zcbosid'
}, {
  component: TaskInfoListPage, name: 'TaskInfoListPage', segment: 'task/infoList'
}, {
  component: FlowPressPage, name: 'FlowPressPage', segment: 'task/press:item'
}];

// WorkModule
import {WorkIndexPage} from '../pages/work/index/index.component'

let WorkLinkers: any = [{
  component: WorkIndexPage, name: 'WorkIndexPage', segment: 'work/index'
}];


// WorkModule
import {TutorialPage} from '../pages/tutorial/tutorial.component'

let TutorialLinkers: any = [{
  component: TutorialPage, name: 'TutorialPage', segment: 'tutorial'
}];

// MarketingModule
import {MarketingIndexPage} from '../pages/marketing/index/index.component'
import {MarketingDailyListPage} from '../pages/marketing/daily/list/list.component';
import {MarketingDailyDetailPage} from '../pages/marketing/daily/detail/detail.component';
import {MarketingDailyQueryPage} from '../pages/marketing/daily/query/query.component';
import {MarketingDailySavePage} from '../pages/marketing/daily/save/save.component';
import {MarketingWeeklyListPage} from '../pages/marketing/weekly/list/list.component';
import {FormatTextToHtml, MarketingWeeklyDetailPage} from '../pages/marketing/weekly/detail/detail.component';
import {MarketingWeeklyQueryPage} from '../pages/marketing/weekly/query/query.component';
import {MarketingOrganizationChoosePage} from "../pages/marketing/organization/choose/choose.component";
import {MarketingAgencyChoosePage} from '../pages/marketing/agency/choose/choose.component';
import {MarketingWeeklyEditPage} from '../pages/marketing/weekly/edit/edit.component';
import {MarketingDailyCollectPage} from '../pages/marketing/daily/collect/collect.component';
import {MarketingLineupListPage} from '../pages/marketing/lineup/list/list.component';
import {MarketingLineupDetailPage} from '../pages/marketing/lineup/detail/detail.component';
import {MarketingLineupQueryPage} from '../pages/marketing/lineup/query/query.component';
import {MarketingLineupSavePage} from '../pages/marketing/lineup/save/save.component';
import {MarketingHomePage} from '../pages/marketing/home/home.component';
import {MarketingMobileAnalyListPage, ColTrendComponent} from '../pages/marketing/mobileanaly/list/list.component';
import {MarketingMobilePage, EndSymbolComponent, TrendComponent} from './../pages/marketing/mobile/mobile.component';
import {MarketingInstitutionPage} from '../pages/marketing/institution/institution.component';
import {MarketingMutualFundWeeklyPage} from '../pages/marketing/mfweekly/mfweekly.component';
import {MarketingMutualFundMonthlyPage} from '../pages/marketing/mfmonthly/mfmonthly.component';
import {MarketingProductionMangePage} from '../pages/marketing/manage/mange.component';

let MarketingLinkers: any = [{
  component: MarketingIndexPage, name: 'MarketingIndexPage', segment: 'marketing/index'
}, {
  component: MarketingDailyListPage, name: 'MarketingDailyListPage', segment: 'marketing/daily/list'
}, {
  component: MarketingDailyDetailPage, name: 'MarketingDailyDetailPage', segment: 'marketing/daily/detail'
}, {
  component: MarketingDailyQueryPage, name: 'MarketingDailyQueryPage', segment: 'marketing/daily/query'
}, {
  component: MarketingWeeklyListPage, name: 'MarketingWeeklyListPage', segment: 'marketing/weekly/list'
}, {
  component: MarketingWeeklyDetailPage, name: 'MarketingWeeklyDetailPage', segment: 'marketing/weekly/detail'
}, {
  component: MarketingWeeklyQueryPage, name: 'MarketingWeeklyQueryPage', segment: 'marketing/weekly/query'
}, {
  component: MarketingDailySavePage, name: 'MarketingDailySavePage', segment: 'marketing/daily/save'
}, {
  component: MarketingOrganizationChoosePage,
  name: 'MarketingOrganizationChoosePage',
  segment: 'marketing/organization/choose'
}, {
  component: MarketingAgencyChoosePage, name: 'MarketingAgencyChoosePage', segment: 'marketing/agency/choose'
}, {
  component: MarketingWeeklyEditPage, name: 'MarketingWeeklyEditPage', segment: 'marketing/weekly/edit'
}, {
  component: MarketingDailyCollectPage, name: 'MarketingDailyCollectPage', segment: 'marketing/daily/collect'
}, {
  component: MarketingLineupListPage, name: 'MarketingLineupListPage', segment: 'marketing/lineup/list'
}, {
  component: MarketingLineupDetailPage, name: 'MarketingLineupDetailPage', segment: 'marketing/lineup/detail'
}, {
  component: MarketingLineupQueryPage, name: 'MarketingLineupQueryPage', segment: 'marketing/lineup/query'
}, {
  component: MarketingLineupSavePage, name: 'MarketingLineupSavePage', segment: 'marketing/lineup/save'
}, {
  component: MarketingHomePage, name: 'MarketingHomePage', segment: 'marketing/home'
}, {
  component: MarketingMobilePage, name: "MarketingMobilePage", segment: "marketing/mobile"
}, {
  component: MarketingCreditListPage, name: "MarketingCreditListPage", segment: "marketing/credit/list"
}, {
  component: MarketingCreditListDetailPage,
  name: "MarketingCreditListDetailPage",
  segment: "marketing/credit/listDetail"
}, {
  component: MarketingCreditQueryPage, name: "MarketingCreditQueryPage", segment: "marketing/credit/query"
}, {
  component: MarketingMobileAnalyListPage, name: "MarketingMobileAnalyListPage", segment: "marketing/mobileanaly/list"
}, {
  component: MarketingInstitutionPage, name: "MarketingInstitutionPage", segment: "marketing/institution"
}, {
  component: MarketingMutualFundWeeklyPage, name: "MarketingMutualFundWeeklyPage", segment: "marketing/mfweekly"
}, {
  component: MarketingMutualFundMonthlyPage, name: "MarketingMutualFundMonthlyPage", segment: "marketing/mfmonthly"
}, {
  component: MarketingProductionMangePage, name: "MarketingProductionMangePage", segment: "marketing/mange"
}];

import {IpmIndexPage} from "../pages/ipm/index/index.component";
import {IpmCirculatePage} from "../pages/ipm/circulate/circulate.component";
import {IpmCirculateModal} from "../pages/ipm/circulate/circulate.modal";
import {IpmCashPage} from "../pages/ipm/cash/cash.component";
import {IpmCoinPage} from "../pages/ipm/coin/coin.component";
import {IpmColumnModal} from "../pages/ipm/coin/column.modal";
import {IpmCoinFilterModal} from "../pages/ipm/coin/filter.modal";
import {IpmCoinDeleteModal} from "../pages/ipm/coin/delete.modal";
import {IpmCoinSaveSceneModal} from "../pages/ipm/coin/saveScene.modal";
import {IpmCoinSelectStockNoModal} from "../pages/ipm/coin/selectStockNo.modal";
import {IpmCoinSelectDepositModal} from "../pages/ipm/coin/selectDeposit.modal";
import {IpmCashDetailPage} from "../pages/ipm/cash/detail.component";
//import {IpmInterbankPage} from "../pages/ipm/interbank/interbank.component";
//import {IpmInterbankModal} from "../pages/ipm/interbank/interbank.modal";
let IpmLinkers = [
  {
    component: IpmIndexPage, name: 'IpmIndexPage', segment: 'ipm/index'
  }, {
    component: IpmCirculatePage, name: 'IpmCirculatePage', segment: 'ipm/circulate'
  }, {
    component: IpmCirculateModal, name: 'IpmCirculateModal', segment: 'ipm/circulate/modal'
  }, {
    component: IpmCashPage, name: 'IpmCashPage', segment: 'ipm/cash'
  }, {
    component: IpmCoinPage, name: 'IpmCoinPage', segment: 'ipm/coin'
  }, {
    component: IpmColumnModal, name: 'IpmColumnModal', segment: 'ipm/coin/modal/column'
  }, {
    component: IpmCoinFilterModal, name: 'IpmCoinFilterModal', segment: 'ipm/coin/modal/filter'
  }, {
    component: IpmCoinDeleteModal, name: 'IpmCoinDeleteModal', segment: 'ipm/coin/modal/delete'
  }, {
    component: IpmCoinSaveSceneModal, name: 'IpmCoinSaveSceneModal', segment: 'ipm/coin/modal/saveScene'
  }, {
    component: IpmCoinSelectStockNoModal, name: 'IpmCoinSelectStockNoModal', segment: 'ipm/coin/modal/selectStockNo'
  }, {
    component: IpmCoinSelectDepositModal, name: 'IpmCoinSelectDepositModal', segment: 'ipm/coin/modal/selectDeposit'
  }, {
    component: IpmCashDetailPage, name: 'IpmCashDetailPage', segment: 'ipm/cash/page/detail'
  }/*, {
   component: IpmInterbankPage, name: "IpmInterbankPage", segment: "ipm/interbank"
   }, {
   component: IpmInterbankModal, name: "IpmInterbankModal", segment: "ipm/interbank/modal"
   }*/
];

import {GfrNetValuePage} from "../pages/gfr/netvalue/netvalue.component";
let GfrLinkers: any = [
  {
    component: GfrNetValuePage, name: 'GfrNetValuePage', segment: 'gfr/netvalue'
  }
];

import {BcwHomePage} from "../pages/bcw/home/home.component";
import {BcwHomeListPage} from "../pages/bcw/home/list.component";
import {BcwHomeDetailPage} from "../pages/bcw/home/detail.component";
import {BadgeBgColorDirective, BcwRulePage} from "../pages/bcw/rule/rule.component";
import {BcwWarnPage} from "../pages/bcw/warn/warn.component";
import {BcwHomeDetailPdfPage} from "../pages/bcw/home/pdf.component";
let BcwLinkers: any = [
  {
    component: BcwHomePage, name: 'BcwHomePage', segment: 'bcw/home'
  }, {
    component: BcwHomeListPage, name: 'BcwHomeListPage', segment: 'bcw/home/list'
  }, {
    component: BcwHomeDetailPage, name: 'BcwHomeDetailPage', segment: 'bcw/home/detail'
  }, {
    component: BcwRulePage, name: 'BcwRulePage', segment: 'bcw/rule'
  }, {
    component: BcwWarnPage, name: 'BcwWarnPage', segment: 'bcw/warn'
  }, {
    component: BcwHomeDetailPdfPage, name: 'BcwHomeDetailPdfPage', segment: 'bcw/home/pdf'
  }
];

import {IrpQjtHomePage} from "../pages/irp/panoramagram/home/home.component";
import {IrpQjtHomeDetailPage} from "../pages/irp/panoramagram/detail/detail.component";
import {IrpPanoramagramMainPage} from "../pages/irp/panoramagram/main/main.component";
import {IrpQjtMorePage} from "../pages/irp/panoramagram/more/more.component";
import {IrpQjtPersonPage} from "../pages/irp/panoramagram/person/person.component";
import {IrpQjtpersonDetailPage} from "../pages/irp/panoramagram/personDetail/personDetail.component";
import {IrpSchedulerListPage} from "../pages/irp/scheduler/list/list.component";
import {IrpInternalReportListPage} from "../pages/irp/report/inside/list/list.component";
import {IrpInternalReportDetailPage} from "../pages/irp/report/inside/detail/detail.component";
import {Irpreportmainpage} from "../pages/irp/report/main/main.component";
import {IrpReportOutsideListPage} from "../pages/irp/report/outside/list/list.component";
import {IrpReportOutsideDetailPage} from "../pages/irp/report/outside/detail/detail.component";
import {IrpReportInsideQueryPage} from "../pages/irp/report/query/insidequery/query.component";
import {IrpReportOutsideQueryPage} from "../pages/irp/report/query/outsidequery/query.component";
import {IrpPoolListPage} from "../pages/irp/pool/list/list.component";
import {IrpPoolQueryPage} from "../pages/irp/pool/query/query.component";
import {IrpPositionListPage} from "../pages/irp/position/list/list.component";
import {IrpReportCollectListPage} from "../pages/irp/report/collect/list/list.component";
import {IrpReportCollectDetailPage} from "../pages/irp/report/collect/detail/detail.component";

let IrpLinkers: any = [
  {
    component: IrpPanoramagramMainPage, name: 'IrpPanoramagramMainPage', segment: 'irp/panoramagram/main'
  },
  {
    component: IrpQjtHomePage, name: 'IrpQjtHomePage', segment: 'irp/panoramagram/home'
  },
  {
    component: IrpQjtHomeDetailPage, name: 'IrpQjtHomeDetailPage', segment: 'irp/panoramagram/detail'
  },
  {
    component: IrpQjtMorePage, name: 'IrpQjtMorePage', segment: 'irp/panoramagram/more'
  },
  {
    component: IrpQjtPersonPage, name: 'IrpQjtPersonPage', segment: 'irp/panoramagram/person'
  },
  {
    component: IrpQjtpersonDetailPage, name: 'IrpQjtpersonDetailPage', segment: 'irp/panoramagram/personDetail'
  },
  {
    component: IrpSchedulerListPage, name: 'IrpSchedulerListPage', segment: 'irp/scheduler/list'
  },
  {
    component: IrpInternalReportListPage, name: 'IrpInternalReportListPage', segment: 'irp/report/inside/list'
  },
  {
	component: IrpInternalReportDetailPage, name: 'IrpInternalReportDetailPage', segment: 'irp/report/inside/detail'
  },
  {
    component: IrpReportCollectListPage, name: 'IrpReportCollectListPage', segment: 'irp/report/collect/list'
  },
  {
    component: IrpReportCollectDetailPage, name: 'IrpReportCollectDetailPage', segment: 'irp/report/collect/detail'
    },
  {
	component: Irpreportmainpage, name: 'Irpreportmainpage', segment: 'irp/report/main'
  },
  {
	component: IrpReportOutsideListPage, name: 'IrpReportOutsideListPage', segment: 'irp/report/outside/list'
  },
  {
	component: IrpReportOutsideDetailPage, name: 'IrpReportOutsideDetailPage', segment: 'irp/report/outside/detail'
  },
  {
	component: IrpReportInsideQueryPage, name: 'IrpReportInsideQueryPage', segment:'irp/report/query/insidequery'
  },
  {
	component: IrpReportOutsideQueryPage, name: 'IrpReportOutsideQueryPage', segment:'irp/report/query/outsidequery'

  },
  {
    component: StockRecommendPage, name: 'StockRecommendPage', segment: 'irp/stock-recommend'
  },
  {
    component: StockSearchPage, name: 'StockSearchPage', segment: 'irp/stock-recommend/stock-search'
  },
  {
    component: MorningStockRecommendPage, name: 'MorningStockRecommendPage', segment: 'irp/morningStock-recommend'
  },
  {
    component: StrategyRecommendPage, name: "StrategyRecommendPage", segment: 'irp/strategy-recommend'

  },
  {
    component: StrategySearchPage, name: 'StrategySearchPage', segment: 'irp/strategy-recommend/strategy-search'
  },
  {
    component: IrpPositionListPage, name: 'IrpPositionListPage', segment: 'irp/position/list'
  },
  {
    component: IrpHotStockHomePage, name: 'IrpHotStockHomePage', segment: 'irp/hotStock/home'
  },
  {
    component: IrpHotStockHMorePage, name: 'IrpHotStockHMorePage', segment: 'irp/hotStock/more'
  },
  {
    component: IrpHotStockHomeDetailPage, name: 'IrpHotStockHomeDetailPage', segment: 'irp/hotStock/detail'
  },{
    component: IrpPoolListPage, name: 'IrpPoolListPage', segment: 'irp/pool/list'
  },
  {
    component: IrpPositionListPage, name: 'IrpPositionListPage', segment: 'irp/position/list'
  },
  {
    component: IrpPoolQueryPage, name: 'IrpPoolQueryPage', segment: 'irp/pool/query'
  }
];

//管道
import {AbsPipe} from "../pages/marketing/home/home.pipe";
import {Addunit} from "../pages/draft/detail/unit.pipe"

let _pages: any = [
  // pdf
  PdfViewerComponent,

  // app
  GfoaApp,

  // Archive module
  ArchivePage,

  // Authorization module
  AuthorizationListPage,
  AuthorizationDetailPage,
  SysDirPage,

  // Contact module
  ContactListPage,
  ContactChoosePage,
  ContactDetailPage,

  // Demo module
  DemoListPage,
  DemoDetailPage,

  // Draft module
  DraftListPage,
  DraftDetailPage,

  DraftAddrModal,
  DraftCompanyCodeModal,
  DraftIndustryInfoModal,

  // Email module
  EmailListPage,
  EmailIndexPage,
  EmailDetailPage,
  EmailSendPage,
  EmailQueryPage,

  // Flow module
  FlowListPage,
  FlowQueryPage,
  FlowTypePage,

  // Info module
  InfoListPage,
  InfoDetailPage,

  // Lock module
  LockPage,

  // Login module
  LoginPage,

  // Main module
  MainPage,

  // Todo module
  TodoPage,

  // Setting module
  SettingIndexPage,
  SettingNotePage,
  SettingFeedbackPage,
  SettingSealPage,
  SettingPushPage,

  // Tabs module
  TabsPage,

  // Task module
  TaskListPage,
  TaskDetailPage,
  EmpPage,
  BT0107Page,
  FlowApprovalPage,
  FlowLogPage,
  CashPlanPage,
  ZcmxPage,
  ZcmxListPage,
  TaskInfoListPage,
  FlowPressPage,

  // Work module
  WorkIndexPage,

  // Tutorial module
  TutorialPage,

  // Marketing module
  MarketingIndexPage,
  MarketingDailyListPage,
  MarketingWeeklyListPage,
  MarketingDailyDetailPage,
  MarketingDailyQueryPage,
  MarketingWeeklyDetailPage,
  MarketingWeeklyQueryPage,
  MarketingDailySavePage,
  MarketingOrganizationChoosePage,
  MarketingAgencyChoosePage,
  MarketingWeeklyEditPage,
  MarketingDailyCollectPage,
  MarketingLineupListPage,
  MarketingLineupDetailPage,
  MarketingLineupQueryPage,
  MarketingLineupSavePage,
  MarketingCreditListPage,
  MarketingCreditListDetailPage,
  MarketingCreditQueryPage,
  MarketingHomePage,
  MarketingMobilePage,
  EndSymbolComponent,
  TrendComponent,
  MarketingMobileAnalyListPage,
  ColTrendComponent,
  MarketingInstitutionPage,
  MarketingMutualFundWeeklyPage,
  MarketingMutualFundMonthlyPage,
  MarketingProductionMangePage,

  //IPM Module
  IpmIndexPage,
  IpmCirculatePage,
  IpmCirculateModal,
  IpmCashPage,
  IpmCoinPage,
  IpmColumnModal,
  IpmCoinFilterModal,
  IpmCoinDeleteModal,
  IpmCoinSaveSceneModal,
  IpmCoinSelectStockNoModal,
  IpmCoinSelectDepositModal,
  IpmCashDetailPage,
  //IpmInterbankPage,
  //IpmInterbankModal,

  // GFR Module
  GfrNetValuePage,

  // BCW Module
  BcwHomePage,
  BcwHomeListPage,
  BcwHomeDetailPage,
  BcwRulePage,

  //IRP Module
  IrpPanoramagramMainPage,
  IrpQjtHomePage,
  IrpQjtHomeDetailPage,
  IrpQjtMorePage,
  IrpQjtPersonPage,
  IrpQjtpersonDetailPage,
  IrpHotStockHomePage,
  IrpHotStockHMorePage,
  IrpHotStockHomeDetailPage,
  IrpSchedulerListPage,
  IrpInternalReportListPage,
  IrpInternalReportDetailPage,
  Irpreportmainpage,
  IrpReportOutsideListPage,
  IrpReportOutsideDetailPage,
  IrpReportCollectListPage,
  IrpReportCollectDetailPage,
  IrpReportInsideQueryPage,
  IrpReportOutsideQueryPage,
  IrpPoolListPage,
  IrpPoolQueryPage,
  IrpPositionListPage,

  //BCWModule
  BcwWarnPage,
  BcwHomeDetailPdfPage,
  StockRecommendPage,
  StockSearchPage,
  MorningStockRecommendPage,
  StrategyRecommendPage,
  StrategySearchPage
];

let _linkers = _.concat(ArchiveLinkers,
  AuthorizationLinkers,
  ContactLinkers,
  DemoLinkers,
  DraftLinkers,
  EmailLinkers,
  FlowLinkers,
  InfoLinkers,
  LockLinkers,
  LoginLinkers,
  MainLinkers,
  SettingLinkers,
  TabsLinkers,
  TaskLinkers,
  WorkLinkers,
  TutorialLinkers,
  MarketingLinkers,
  IpmLinkers,
  GfrLinkers,
  BcwLinkers,
  IrpLinkers
);

import {FormatDataPipe} from "../pages/ipm/coin/coin.component";
import {FormatGFRDataPipe, DataColorDirective} from "../pages/gfr/netvalue/netvalue.component";

let _pipes: any = [AbsPipe, FormatDataPipe, FormatGFRDataPipe, Addunit, FormatTextToHtml];

import {MarketingCreditListDetailPage} from "../pages/marketing/credit/listDetail/listDetail.component";
import {MarketingCreditListPage} from "../pages/marketing/credit/list/list.component";
import {MarketingCreditQueryPage} from "../pages/marketing/credit/query/query.component";
import { from } from 'rxjs/observable/from';
import {StockRecommendPage} from "../pages/irp/stock-recommend/stock-recommend.component";
import {MorningStockRecommendPage} from "../pages/irp/morningStock-recommend/morningStock-recommend.component";
import {StrategyRecommendPage} from "../pages/irp/strategy-recommend/strategy-recommend";
import {StockSearchPage} from "../pages/irp/stock-recommend/stock-search/stock-search";
import {IrpHotStockHomePage} from "../pages/irp/hotStock/home/home.component";
import {IrpHotStockHMorePage} from "../pages/irp/hotStock/more/more.component";
import {IrpHotStockHomeDetailPage} from "../pages/irp/hotStock/detail/detail.component";
import {StrategySearchPage} from "../pages/irp/strategy-recommend/strategy-search/strategy-search";

let _directive = [DataColorDirective, BadgeBgColorDirective];

export const pages = _pages;

export const linkers = _linkers;

export const providers = _providers;

export const pipes = _pipes;

export const directive = _directive;
